package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
public class CustomerTraceHistory {
    private Long id;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date traceTime;
    private String traceDetails;
    private SystemDictionaryItem traceType;
    private Integer traceResult;
    private String remark;
    private Customer customer;
    private Employee inputUser;
    private Date inputTime;
    private Integer type = 0;//用默认值 ,最好用getTypeName
    public String getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("traceTime",traceTime);
        map.put("traceDetails",traceDetails);
        map.put("traceType",traceType);
        map.put("traceResult",traceResult);
        map.put("remark",remark);
        map.put("customer",customer);
        map.put("inputUser",inputUser);
        map.put("inputTime",inputTime);
        map.put("type",type);

        return JSON.toJSONString(map);
    }

}